//package com.gosling.cloudspace.config;
//
//import org.springframework.amqp.core.*;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * 消息中间件
// *
// * @email 1793327033@qq.com
// * @classname RabbitMQConfig
// * @author: osc_lihonglin
// * @date: 2021/6/23 22:04
// */
//@Configuration
//public class RabbitMQConfig {
//
//    public static final String EXCHANGE_NAME = "boot_topic_exchange";
//    public static final String MQ_MESSAGE_QUEUE_1 = "mq_message_queue_1";
//    public static final String QUEUE_NAME = "bootQueueMessage";
//    public static final String BOOT_EXCHANGE = "bootExchangeMessage";
//
//    /**
//     * 1.交换机
//     * @return
//     */
//    @Bean(BOOT_EXCHANGE)
//    public Exchange bootExchange() {
//        return ExchangeBuilder.topicExchange(EXCHANGE_NAME).durable(true).build();
//    }
//
//    /**
//     * 2.Queue 队列
//     * @return
//     */
//    @Bean(QUEUE_NAME)
//    public Queue bootQueue() {
//        return QueueBuilder.durable(QUEUE_NAME).withArgument("x-message-ttl", 5000).build();
//    }
//
//    /**
//     * 3. 队列和交互机绑定关系
//     *
//     * @param queue
//     * @param exchange
//     * @return
//     */
//    @Bean
//    public Binding bindQueueExchange(@Qualifier(QUEUE_NAME) Queue queue, @Qualifier(BOOT_EXCHANGE) Exchange exchange) {
//        return BindingBuilder.bind(bootQueue()).to(bootExchange()).with("msgKey").noargs();
//    }
//}
